package com.yztc.yidoutang.activity.main_activity;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.ViewPager;

import com.yztc.yidoutang.adapter.ViewPagerAdapter;
import com.yztc.yidoutang.fragment.fragment_wode.WoDeFragment;
import com.yztc.yidoutang.fragment.jingxuan_fragment.JingXuanFragment;
import com.yztc.yidoutang.fragment.sousuo_fragment.SouSuoFragment;
import com.yztc.yidoutang.fragment.zhuye_fragment.ZhuYeFragment;

import java.util.ArrayList;
import java.util.List;


/**
 * 用在MainActivity中的Model类
 */
public class MainModel implements MainContract.Model {

    @Override
    public void initViewPager(FragmentActivity activity, List<Fragment> fragmentList, ViewPager vp) {
        fragmentList = new ArrayList<>();
        fragmentList.add(new ZhuYeFragment());

        fragmentList.add(new JingXuanFragment());
        fragmentList.add(new SouSuoFragment());
        fragmentList.add(new WoDeFragment());

        ViewPagerAdapter adapter = new ViewPagerAdapter(activity.getSupportFragmentManager(), fragmentList);
        vp.setAdapter(adapter);
    }

}